package com.example.app.appstart

import android.content.Context
import com.example.app.database.DBManager
import com.example.app.global.GlobalUserManager
import com.example.app.manager.LogManager
import com.example.app.manager.giftplay.SvgaManager
import com.example.app.manager.giftplay.VapManager
import com.libcommon.LiveEventManager
import com.libcommon.mmkv.MKManager
import com.other.FirebaseCrashManager
import com.rousetime.android_startup.AndroidStartup


/**
 * CreateBy:Joker
 * CreateTime:2023/4/28 14:26
 * description：三方库
 */
class ThirdLibStartup : AndroidStartup<String>() {

    override fun callCreateOnMainThread(): Boolean = true

    override fun waitOnMainThread(): Boolean = true

    override fun create(context: Context): String? {
        //数据存储
        MKManager.init(context)

        //日志库初始化
        LogManager.init()

        // 总线事件初始化
        LiveEventManager.init()

        FirebaseCrashManager.init { "${GlobalUserManager.getUid()}" }

        //svga初始化
        SvgaManager.initSvga(context)
        VapManager.init()

        //数据库初始化
        DBManager.init()

        return this.javaClass.name
    }

}